<div id="h_main" class="main_width">
   
    <!--- search --->
    <?php echo $this->element('search_service'); ?>
    <!--- end search -->
    <!-- breadcrumb -->
    <?php echo $this->element('breadcrumb',array('breadcrumb' => $breadcrumb)); ?>
    <!-- end breadcrumb -->
<div id="h_feature" class="" style="margin-bottom:20px;">
        <div class="h_container_list">
        
        <ul class="h_list_product">
            <?php foreach($products as $value):?>
            <li>
                <div class="h_product_image pull-left" style="position: relative;">
                    <?php if(strtotime(date('Y-m-d', strtotime($value['product']['created'].' + 7 day'))) >= strtotime(date('Y-m-d', time()))){ echo  '<img class="img_new" src="'.$this->webroot.'images/new.gif" />';  }?>
                    <a href="<?php echo $this->Html->url('/home/productview/'.$value['product']['product_id']);?>"><img src="<?php echo $this->webroot . URL_PRODUCT_IMAGE . $value['product']['image'] ?>" /></a>
                </div>
                <div class="h_product_detail pull-left">
                    <div class="detail_top">
                        <h4>
                            <a class="h_product_name" href="<?php echo $this->Html->url('/home/productview/'.$value['product']['product_id']);?>"><?php echo $value['product_language']['name'] ?></a>
                        </h4>
                        <span class="h_bold"> Price</span> : <span class="h_price">
                        $<?php echo $value['product']['price'] ?> <?php echo $unitprice = $value['product']['unit_price'] == 2 ? '/m2' : '/month'; ?></span><br/>
						<span class="h_bold">Location</span> : <?php echo $value['product']['address'].' / '.$value['address_truelever']['district'].' , '.$value['address_truelever']['city']; ?></br>
						<?php if(is_array($value['property_value'])){?>
						<?php foreach($value['property_value'] as $property_type=>$val){ ?>
							<?php 
								if(!($val['property_language']) || !($val['property_value_language'])) {continue;}
								if(in_array($val['property_id'], Configure::read('Property.hideen'))) {continue;}
								if(in_array($val['property_id'], Configure::read('Property.value_m2'))){ $val['property_value_language'] = $val['property_value_language'].'m2';}
							?>
							<span class="h_bold"><?php echo $val['property_language']?></span>  <?php echo $val['property_value_language'].'</br>'; ?>
							
						<?php  } }?>
                    </div>
                </div>
                <br class="clearBoth" />
                <p class="p_producttype"><?php echo $value['product_type']['name'];?></p>
            </li>
            <?php endforeach; ?>
           <div class="clearBoth"></div>
        </ul>
		</div>
    </div>
</div>